.class public Lcom/glympse/android/glympse/DlgActions$ActionAdapter;
.super Landroid/widget/ArrayAdapter;
.source "DlgActions.java"


# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/glympse/android/glympse/DlgActions;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x4
    name = "ActionAdapter"
.end annotation

.annotation system Ldalvik/annotation/Signature;
    value = {
        "Landroid/widget/ArrayAdapter",
        "<",
        "Lcom/glympse/android/glympse/DlgActions$Action;",
        ">;"
    }
.end annotation


# instance fields
.field final synthetic this$0:Lcom/glympse/android/glympse/DlgActions;


# direct methods
.method public constructor <init>(Lcom/glympse/android/glympse/DlgActions;Landroid/content/Context;Ljava/util/ArrayList;)V
    .locals 1
    .parameter
    .parameter "oContext"
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Landroid/content/Context;",
            "Ljava/util/ArrayList",
            "<",
            "Lcom/glympse/android/glympse/DlgActions$Action;",
            ">;)V"
        }
    .end annotation

    .prologue
    .line 353
    .local p3, listActions:Ljava/util/ArrayList;,"Ljava/util/ArrayList<Lcom/glympse/android/glympse/DlgActions$Action;>;"
    iput-object p1, p0, Lcom/glympse/android/glympse/DlgActions$ActionAdapter;->this$0:Lcom/glympse/android/glympse/DlgActions;

    .line 352
    const/4 v0, 0x0

    invoke-direct {p0, p2, v0, p3}, Landroid/widget/ArrayAdapter;-><init>(Landroid/content/Context;ILjava/util/List;)V

    return-void
.end method


# virtual methods
.method public getView(ILandroid/view/View;Landroid/view/ViewGroup;)Landroid/view/View;
    .locals 8
    .parameter "nPosition"
    .parameter "convertView"
    .parameter "parent"

    .prologue
    const v6, 0x7f0c007c

    const/4 v7, 0x5

    .line 358
    invoke-virtual {p0, p1}, Lcom/glympse/android/glympse/DlgActions$ActionAdapter;->getItem(I)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/glympse/android/glympse/DlgActions$Action;

    .line 360
    .local v1, oAction:Lcom/glympse/android/glympse/DlgActions$Action;
    invoke-virtual {p0}, Lcom/glympse/android/glympse/DlgActions$ActionAdapter;->getContext()Landroid/content/Context;

    move-result-object v4

    invoke-static {v4}, Landroid/view/LayoutInflater;->from(Landroid/content/Context;)Landroid/view/LayoutInflater;

    move-result-object v0

    .line 361
    .local v0, inflater:Landroid/view/LayoutInflater;
    iget v4, v1, Lcom/glympse/android/glympse/DlgActions$Action;->m_eAction:I

    if-nez v4, :cond_1

    .line 362
    const v4, 0x7f030022

    :goto_0
    const/4 v5, 0x0

    .line 361
    invoke-virtual {v0, v4, p3, v5}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;Z)Landroid/view/View;

    move-result-object v4

    iput-object v4, v1, Lcom/glympse/android/glympse/DlgActions$Action;->m_oView:Landroid/view/View;

    .line 365
    iget-object v4, v1, Lcom/glympse/android/glympse/DlgActions$Action;->m_oView:Landroid/view/View;

    const v5, 0x7f0c007b

    invoke-virtual {v4, v5}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v2

    check-cast v2, Landroid/widget/ImageView;

    .line 366
    .local v2, oImageView:Landroid/widget/ImageView;
    iget v4, v1, Lcom/glympse/android/glympse/DlgActions$Action;->m_nImage:I

    invoke-virtual {v2, v4}, Landroid/widget/ImageView;->setImageResource(I)V

    .line 367
    iget-object v4, v1, Lcom/glympse/android/glympse/DlgActions$Action;->m_oView:Landroid/view/View;

    const v5, 0x7f0c006f

    invoke-virtual {v4, v5}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v4

    check-cast v4, Landroid/widget/TextView;

    iget-object v5, v1, Lcom/glympse/android/glympse/DlgActions$Action;->m_strName:Ljava/lang/String;

    invoke-virtual {v4, v5}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 370
    const/4 v4, 0x3

    iget v5, v1, Lcom/glympse/android/glympse/DlgActions$Action;->m_eAction:I

    if-ne v4, v5, :cond_2

    iget-object v4, p0, Lcom/glympse/android/glympse/DlgActions$ActionAdapter;->this$0:Lcom/glympse/android/glympse/DlgActions;

    invoke-static {v4}, Lcom/glympse/android/glympse/DlgActions;->access$0(Lcom/glympse/android/glympse/DlgActions;)Lcom/glympse/platform/common/User;

    move-result-object v4

    if-eqz v4, :cond_2

    .line 372
    iget-object v4, v1, Lcom/glympse/android/glympse/DlgActions$Action;->m_oView:Landroid/view/View;

    invoke-virtual {v4, v6}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v3

    check-cast v3, Landroid/widget/TextView;

    .line 373
    .local v3, oText:Landroid/widget/TextView;
    new-instance v4, Ljava/lang/StringBuilder;

    iget-object v5, p0, Lcom/glympse/android/glympse/DlgActions$ActionAdapter;->this$0:Lcom/glympse/android/glympse/DlgActions;

    invoke-static {v5}, Lcom/glympse/android/glympse/DlgActions;->access$0(Lcom/glympse/android/glympse/DlgActions;)Lcom/glympse/platform/common/User;

    move-result-object v5

    invoke-virtual {v5}, Lcom/glympse/platform/common/User;->GetLocPoint()Lcom/glympse/platform/common/LocPoint;

    move-result-object v5

    iget-wide v5, v5, Lcom/glympse/platform/common/LocPoint;->m_dLatitude:D

    invoke-static {v5, v6, v7}, Lcom/glympse/platform/common/Helpers;->DoubleToStr(DI)Ljava/lang/String;

    move-result-object v5

    invoke-static {v5}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v5

    invoke-direct {v4, v5}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v5, ", "

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    iget-object v5, p0, Lcom/glympse/android/glympse/DlgActions$ActionAdapter;->this$0:Lcom/glympse/android/glympse/DlgActions;

    invoke-static {v5}, Lcom/glympse/android/glympse/DlgActions;->access$0(Lcom/glympse/android/glympse/DlgActions;)Lcom/glympse/platform/common/User;

    move-result-object v5

    invoke-virtual {v5}, Lcom/glympse/platform/common/User;->GetLocPoint()Lcom/glympse/platform/common/LocPoint;

    move-result-object v5

    iget-wide v5, v5, Lcom/glympse/platform/common/LocPoint;->m_dLongitude:D

    invoke-static {v5, v6, v7}, Lcom/glympse/platform/common/Helpers;->DoubleToStr(DI)Ljava/lang/String;

    move-result-object v5

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v3, v4}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 383
    .end local v3           #oText:Landroid/widget/TextView;
    :cond_0
    :goto_1
    iget-object v4, v1, Lcom/glympse/android/glympse/DlgActions$Action;->m_oView:Landroid/view/View;

    return-object v4

    .line 362
    .end local v2           #oImageView:Landroid/widget/ImageView;
    :cond_1
    const v4, 0x7f030021

    goto :goto_0

    .line 377
    .restart local v2       #oImageView:Landroid/widget/ImageView;
    :cond_2
    const/4 v4, 0x1

    iget v5, v1, Lcom/glympse/android/glympse/DlgActions$Action;->m_eAction:I

    if-eq v4, v5, :cond_3

    .line 378
    const/4 v4, 0x2

    iget v5, v1, Lcom/glympse/android/glympse/DlgActions$Action;->m_eAction:I

    if-ne v4, v5, :cond_0

    .line 380
    :cond_3
    iget-object v4, v1, Lcom/glympse/android/glympse/DlgActions$Action;->m_oView:Landroid/view/View;

    invoke-virtual {v4, v6}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v4

    check-cast v4, Landroid/widget/TextView;

    iget-object v5, p0, Lcom/glympse/android/glympse/DlgActions$ActionAdapter;->this$0:Lcom/glympse/android/glympse/DlgActions;

    invoke-virtual {v5, v1}, Lcom/glympse/android/glympse/DlgActions;->GetDestinationName(Lcom/glympse/android/glympse/DlgActions$Action;)Ljava/lang/String;

    move-result-object v5

    invoke-virtual {v4, v5}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    goto :goto_1
.end method
